diff options
| author | Adam Soltys <[email protected]> | 2022-12-29 16:07:47 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-12-29 16:07:47 -0800 |
| commit | 0f7b6e9dc62c3350f4906bbae21b92732c282983 (patch) | |
| tree | 3406d9706990bf54b2ec86091ab5cf653416b62c /src/routes/(app)/[username]/(profile)/+layout.server.js | |
| parent | 787907b97a34596b1b1c68c8b28a546fec733edd (diff) | |
| download | coinos-ui-0f7b6e9dc62c3350f4906bbae21b92732c282983.tar.gz coinos-ui-0f7b6e9dc62c3350f4906bbae21b92732c282983.zip | |
catch follow errors
Diffstat (limited to 'src/routes/(app)/[username]/(profile)/+layout.server.js')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+layout.server.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.js b/src/routes/(app)/[username]/(profile)/+layout.server.js index 9cd0870d..f4f2ca0a 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.server.js +++ b/src/routes/(app)/[username]/(profile)/+layout.server.js @@ -3,8 +3,20 @@ import { get } from '$lib/utils'; export async function load({ parent }) { let { subject, user } = await parent(); - subject.follows = await get(`/${subject.pubkey}/follows`); - subject.followers = await get(`/${subject.pubkey}/followers`); + subject.follows = []; + subject.followers = []; + + try { + subject.follows = await get(`/${subject.pubkey}/follows`); + } catch (e) { + console.log('problem fetching follows', e); + } + + try { + subject.followers = await get(`/${subject.pubkey}/followers`); + } catch (e) { + console.log('problem fetching followers', e); + } if (user) { user.follows = await get(`/${user.pubkey}/follows?tagsonly=true`); |
